package com.example.literj.kt.internal.util

class Pow2 {
    companion object{
        @JvmStatic
        fun roundToPowerOfTwo(value: Int): Int {
            return 1 shl 32 - Integer.numberOfLeadingZeros(value - 1)
        }

        @JvmStatic
        fun isPowerOfTwo(value: Int): Boolean {
            return value and value - 1 == 0
        }
    }
}